/*
 * @Description: 表单校验规则
 * @Author: chenju
 * @Date: 2022-03-22 17:46:03
 * @LastEditors: chenju
 * @LastEditTime: 2022-12-12 14:13:32
 */
import { emailValidator, mobileValidator } from '@/utils/form-validator';
export const rules = {
  realName: [
    {
      required: true,
      message: '必填项',
      trigger: ['submit', 'change']
    }
  ],
  username: [
    {
      required: true,
      message: '必填项',
      trigger: ['submit', 'change']
    },
    emailValidator()
  ],
  phone: [
    {
      required: true,
      message: '必填项',
      trigger: ['submit', 'change']
    },
    mobileValidator()
  ],
  roleCode: [
    {
      required: true,
      message: '必填项',
      trigger: ['submit', 'change']
    }
  ],
  organizationIds: [
    {
      type: 'array',
      required: true,
      message: '必填项',
      trigger: ['submit', 'change']
    }
  ],
  scopeList: [
    {
      type: 'array',
      required: true,
      message: '必填项',
      trigger: ['submit', 'change']
    }
  ]
};
